package com.aaa.common.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @className Result
 * @Description Result返回类型的设置
 * @Author wyy
 * @Data 2021/1/12 20:10
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result implements Serializable {
    private static final long serialVersionUID=-45456L;

    private Integer code;
    private String msg;
    private Object data;

    public  static Result success(Object data){
        return new Result(0,"success",data);
    }
    public static Result success(String msg){
        return new Result(0,msg,null);
    }
    public  static Result error(String msg){
        return  new Result(1,msg,null);

    }

}
